﻿@model VacationsRequest.Models.Employee
@{
    ViewBag.Title = "Edit";
}
<h2>
    Edit</h2>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery-ui-1.8.11.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(document).ready(function () {
        $('.date').datepicker({dateFormat: "mm/dd/yy"});
    });
</script>
@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Employee</legend>
        @Html.HiddenFor(model => model.ID)
        <div style="display: table; width: 100%">
            <div style="display: table-row">
                <div style="display: table-cell">
                    <div class="editor-label">
                        Team
                    </div>
                    <div class="editor-field">
                        @Html.DropDownListFor(model => model.IdTeam, ViewBag.Teams as SelectList)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        Position
                    </div>
                    <div class="editor-field">
                        @Html.DropDownListFor(model => model.IdPosition, ViewBag.Positions as SelectList)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        Manager
                    </div>
                    <div class="editor-field">
                        @Html.DropDownListFor(model => model.IdManager, ViewBag.Managers as SelectList)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        ID Contractor
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.IdContractor)
                        @Html.ValidationMessageFor(model => model.IdContractor)
                    </div>
                </div>
            </div>
            <div style="display: table-row">
                <div style="display: table-cell">
                    <div class="editor-label">
                        Identification
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.Ced)
                        @Html.ValidationMessageFor(model => model.Ced)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        First Name
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.FirstName)
                        @Html.ValidationMessageFor(model => model.FirstName)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        First Last Name
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.FirstLastName)
                        @Html.ValidationMessageFor(model => model.FirstLastName)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        Second Last Name
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.SecondLastName)
                        @Html.ValidationMessageFor(model => model.SecondLastName)
                    </div>
                </div>
            </div>
            <div style="display: table-row">
                <div style="display: table-cell">
                    <div class="editor-label">
                        Email
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.Email)
                        @Html.ValidationMessageFor(model => model.Email)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        Start Date
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.StartDate)
                        @Html.ValidationMessageFor(model => model.StartDate)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        Rate
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.Rate)
                        @Html.ValidationMessageFor(model => model.Rate)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        Salary
                    </div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.Salary)
                        @Html.ValidationMessageFor(model => model.Salary)
                    </div>
                </div>
            </div>
            <div style="display: table-row">
                <div style="display: table-cell">
                    <div class="editor-label">
                        Active</div>
                    <div class="editor-field">
                        @Html.EditorFor(model => model.Active)
                        @Html.ValidationMessageFor(model => model.Active)
                    </div>
                </div>
                <div style="display: table-cell">
                    <div class="editor-label">
                        Vacation Approver</div>
                    <div class="editor-field">
                        @Html.DropDownListFor(
                    x => x.IdUserApprover,
                    Model.Approvers
                )
                        @Html.ValidationMessageFor(model => model.IdUserApprover)
                    </div>
                </div>
                <div style="display: table-cell">
                </div>
                <div style="display: table-cell">
                </div>
            </div>
        </div>
        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}
<div>
    @Html.ActionLink("Back to List", "Index")
</div>
